package com.formiaomiao.demain.service.impl;

import com.formiaomiao.demain.dao.RedVersionCodeDao;
import com.formiaomiao.demain.model.RedVersionCodeBean;
import com.formiaomiao.demain.model.Result;
import com.formiaomiao.demain.service.RedVersionCodeService;
import com.formiaomiao.demain.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service(value = "redVersionCodeService")
public class RedVersionCodeServiceImpl implements RedVersionCodeService {

    @Autowired
    RedVersionCodeDao redVersionCodeDao;

    @Override
    public Result<RedVersionCodeBean> selectRedCode() {
        if (redVersionCodeDao.SelectRedCode() == null) {
            return ResultUtil.error(60, "apk版本获取失败");
        } else {
            RedVersionCodeBean data = redVersionCodeDao.SelectRedCode();
            return ResultUtil.success(data);
        }
    }
}
